<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateYsRecordTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('record', function(Blueprint $table)
		{
			$table->increments('id')->comment('主键id');
			$table->unsignedInteger('uid')->index()->comment('关联用户id');
			$table->unsignedInteger('book_id')->index()->comment('关联书籍id');
			$table->integer('record')->nullable()->default(0)->index()->comment('阅读章节索引');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('record');
	}

}
